package com.zr.service.impl;

import com.zr.dao.SearchDao;
import com.zr.dao.impl.SearchDaoImpl;
import com.zr.service.SearchService;

import net.sf.json.JSONObject;

public class SearchServiceImpl implements SearchService{

	SearchDao sd = new SearchDaoImpl();
	
	@Override
	public JSONObject getSearch(String combox, String value, int page, int pagesize) {
		
		String string1 = "全文";
		String string2 = "知识标题";
		String string3 = "知识内容";
		String string4 = "摘要";
		String string5 = "专题知识";
		
		if(string1.equals(combox)){
			return sd.getAllBySearch(value, page, pagesize);
		}else if (string2.equals(combox)) {
			return sd.getTitleBySearch(value, page, pagesize);
		}else if (string3.equals(combox)) {
			return sd.getContentBySearch(value, page, pagesize);
		}else if (string4.equals(combox)) {
			return sd.getAbstractBySearch(value, page, pagesize);
		}else {
			return sd.getSpecialBySearch(value, page, pagesize);
		}
	}

}
